package com.edu.app.service.impl.linkservices;

import com.edu.app.bean.core.SysCustomerTrace;
import com.edu.app.bean.virtualbean.trace.TraceBean;

import com.edu.app.mapper.linkmappers.SysCustomerTraceMapper;
import com.edu.app.service.impl.SysBaseServiceImpl;
import com.edu.app.service.sys.linkservices.SysCustomerTraceService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysCustomerTraceServiceImpl extends SysBaseServiceImpl<SysCustomerTrace,SysCustomerTraceMapper> implements SysCustomerTraceService {
    @Autowired
    SysCustomerTraceMapper sysCustomerTraceMapper;

    @Override
    public PageInfo getCustomerTraceByUserId(Integer id, Integer currentPage, Integer pageSize) {
        //设置分页信息，分别是当前页数和每页显示的总记录数【记住：必须在mapper接口中的方法执行之前设置该分页信息】
        PageHelper.startPage(currentPage, pageSize, true);

        List<TraceBean> list = sysCustomerTraceMapper.getCustomerTraceById(id);

        PageInfo<TraceBean> pageInfo = new PageInfo<TraceBean>(list);
        return pageInfo;
    }
}
